<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>会员登录</title>
		<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css" />
		<script src="JS/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="JS/bootstrap.min.js" type="text/javascript"></script>
		<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
		<!-- 引入自定义css文件 style.css -->
		<link rel="stylesheet" href="css/style.css" type="text/css" />

		<style>
			body {
				margin-top: 20px;
				margin: 0 auto;
			}
			
			.carousel-inner .item img {
				width: 100%;
				height: 300px;
			}
		</style>
		
		<script type="text/javascript">
		function FinishOrder(src){

			$.ajax({
		        url:"${pageContext.request.contextPath}/FinishOrderServlet",
		        async:false,
		        type:"post",
		        data:{'orderid':src.name},
		        dataType:"json",
		        success:function(d){
		        	if(d.msg==1&&confirm("确认收货")){
		        		alert("收货成功")
		        		window.location.href="${pageContext.request.contextPath}/ShowOrderServlet";
		        	}else{
		        		alert("收货失败")
		        	}
		        }
		    });
		}
		</script>
	</head>

	<body>

			<!--
            	时间：2015-12-30
            	描述：菜单栏
            -->
			<div class="container-fluid">
				<div class="col-md-4">
					
				</div>
				<div class="col-md-5">
					<img src="img/header.png" />
				</div>
				<div class="col-md-3" style="padding-top:20px">
					<%@ include file="jhtop.jsp" %>   <!-- 顶部动态字 -->
				</div>
			</div>
			<!--
            	时间：2015-12-30
            	描述：导航条
            -->
			<%@ include file="/jhtop1.jsp" %>   <!-- 商品类型显示和搜索框 -->

		

		<div class="container">
			<div class="row">

				<div style="margin:0 auto; margin-top:10px;width:950px;">
				<table class="table table-bordered">
				<tbody >
				<tr class="warning">
				  <th width="10%"> <a href="${pageContext.request.contextPath }/ShowOrderServlet">全部订单</a></th>
				  
				   <c:forEach items="${status}" var="n">
					<th width="10%"><a href="${pageContext.request.contextPath }/ShowStatusServlet?statusid=${n.statusid}">${n.status }</a></th>
					</c:forEach>
					
					</tr>
				</tbody>
					</table>
					
					<table class="table table-bordered">
						<tbody>
							
							<tr class="warning">
							    <th>订单编号</th>
								<th>图片</th>
								<th>商品</th>
								<th>价格</th>
								<th>数量</th>
								<th>小计</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
							<c:forEach items="${orderstatus }" var="n">
							
							<tr class="active">
							    <td width="10%">
									${n.orderid }
								</td>
								
								<td width="40" width="40%">
									<input type="hidden" name="id" value="22">
									<img src="${pageContext.request.contextPath }${n.img }" width="70" height="60">
								</td>
								
								<td width="20%">
									<a target="_blank"> ${n.cmdyname }</a>
								</td>
								
								<td width="20%">
									￥${n.price }
								</td>
								
								<td width="10%">
									${n.ordernum }
								</td>
								
								<td width="10%">
									<span class="subtotal">${n.total }</span>
								</td>
								
								<td width="10%">
									${n.status }
								</td>
								
								<td width="10%">
								  <c:if test="${n.status!='已收货'}">
							         <a onclick="FinishOrder(this)" name="${n.orderid }" href="#"class="delete"><c:out value="确认收货"/></a>
								  </c:if>
								</td>
								
							</tr>
							</c:forEach>
						</tbody>
						
						
						
					</table>
				</div>
			</div>
			
		</div>

		
	</body>

</html>